<template>
<q-layout view="hHh Lpr fFf">
    <!-- Be sure to play with the Layout demo on docs -->

    <!-- (Optional) The Header -->
    <q-header :class="isShow?'back-dark shadow-7':'transparent'">
        <q-toolbar class="transparent " style="width: 100%; height: 50px">
            <q-btn @click="handleBack" falt round icon="mdi-keyboard-backspace"></q-btn>
            <q-img v-if="isShow" src="icons/一方映画logo200708竖版亮色.png" :width="$q.platform.is.mobile ? '150px' : '200px'" contain />

            <q-space></q-space>
            <!-- <q-bar dark style="height: 60px" class="transparent">

                <q-space />

                <q-btn flat dense  @click="handleMinWin" :class="isShow?'':'shadow-7'" icon="mdi-minus" class="items-center">

                    <q-tooltip>窗口还原(Esc)</q-tooltip>
                </q-btn>
                <q-btn flat dense :class="isShow?'':'shadow-7'"  icon="crop_square" @click="handleMaxWin">
                    <q-tooltip>窗口最大化</q-tooltip>
                </q-btn>
                <q-btn flat dense :class="isShow?'':'shadow-7'"  icon="mdi-format-list-bulleted" @click="leftDrawer = !leftDrawer" />

            </q-bar> -->
            <!-- <q-btn flat round dense icon="menu" class="mobile-only q-mr-sm" /> -->
        </q-toolbar>
    </q-header>

    <q-page-container>
        <!-- This is where pages get injected -->
        <router-view :projectInfo="projectInfo" />
    </q-page-container>

</q-layout>
</template>

<script>
export default {
    // name: 'LayoutName',

    data() {
        return {
            projectInfo: null,

            isShow: true,
        }
    },
    created() {
        this.$emit('isSingle', true)
        this.pid = this.$route.params.pid;
        this.projectInfo = this.$store.state.projectinfo;

        this.i_name = setInterval(() => {
            this.projectInfo = this.$store.state.projectinfo;

            if (this.projectInfo.name) {
                document.title = this.projectInfo.name + '--结算';
                clearInterval(this.i_name)
            }

        }, 500);
    },
    beforeDestroy() {
        this.$emit('isSingle', false)
    },
    methods: {
        handleBack() {
            this.$router.replace('/studio/' + this.pid)
        },
    }
}
</script>
